package design2.observer.example.listeners;

import java.io.File;

/**
 * 收到通知后发送邮件
 */
public class EmailNotificationListener implements  EventListener{

    private String email;

    public EmailNotificationListener(String email) {
        this.email = email;
    }

    @Override
    public void update(String eventType, File file) {
        System.out.println("发送到"+email+"的电子邮件：有人对以下文件执行了"+eventType+"操作："+file.getName());
    }
}
